<?php
require('modelo_twitter.php');

if($_POST)
{
	if($_POST['tipo']=='menciones')
	{
		$results=buscar_menciones($_POST['texto']);
//		echo '<pre>'.print_r($results, true).'</pre>';
	}
	else if($_POST['tipo']=='hash')
	{
		$results=buscar_hash($_POST['texto']);
	}
	else if($_POST['tipo']=='palabra')
	{
		$results=buscar_palabra($_POST['texto']);
	}
	
	for($a=0;$a<count($results);$a++)
	{
	echo $a+1;
	?>
	
    <div id="cc" style="width:50%;">
    <table width="100%">
    <tr><td rowspan="3" style="background:#E1F0FC;" width="40px"><img src="<?php echo $results[$a]->profile_image_url; ?>" border="0" width="40px" height="40px"></td>
	<td style="background:#E1F0FC;"><?php echo $results[$a]->from_user;?></td></tr>
    <tr><td style="background:#E1F0FC;"><?php echo $results[$a]->text;?></td></tr>
    <tr><td style="background:#E1F0FC;"><?php echo $results[$a]->created_at;?></td></tr>
    </table>
</div>
<?php //$r2 = $connection->post('statuses/update', array('status'=>'@'.$r1[$a]['user']['screen_name'].' '.'probando replay'));
 }

	
}
?>